﻿using Plugin.Connectivity.Abstractions;
using Sino.CapacityCloud.WebApi.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

namespace Sino.CapacityCloud.Tests.Services
{

    public class CapacityCloudRestfulApiClientEx
        : CapacityCloudRestfulApiClient
    {

        protected readonly HttpClient _externalClient;

        public override Uri BaseAddress
        {
            get
            {
                return null;
            }
        }

        public CapacityCloudRestfulApiClientEx(HttpClient client, IConnectivity connectivity, ConfigurationOptions options)
            : base(connectivity, options)
        {
            this._externalClient = client;
        }

        public override bool Initialize()
        {
            return base.Initialize();
        }

        protected override HttpClient CreateHttpClientInstance()
        {
            return this._externalClient ?? base.CreateHttpClientInstance();
        }

        protected override void OnTrace(object sender, string message, object tag = null)
        {
            base.OnTrace(sender, message, tag);
        }

        protected override void OnError(object sender, string message, Exception ex, object tag = null)
        {
            base.OnError(sender, message, ex, tag);
        }

    }

}